import requestNoToken from '@/utils/authRequest'
import request from '@/utils/authRequestWithToken'

export function register(data) {
  return requestNoToken({
    url: '/authUser/register',
    method: 'post',
    data
  })
}

export function login(method, data) {
  return requestNoToken({
    url: `/authUser/v2/login/${method}`,
    method: 'post',
    data
  })
}

export function getInfo(token) {
  return request({
    url: '/authUser/v2/me',
    method: 'post',
    data: {}
  })
}

export function logout() {
  return request({
    url: '/authUser/logout',
    method: 'post'
  })
}
